package nutella89.basic;

public class J06_Patterns {

	public static void main(String[] args) {
		// 반복문을 이용해서 다양한 패턴 출력하기
		// 패턴1 - 테스트1
		//System.out.println( "1 2 3 4 5 6" );
		//System.out.println( "1 2 3 4 5 6" );
		//System.out.println( "1 2 3 4 5 6" );
		//System.out.println( "1 2 3 4 5 6" );
		//System.out.println( "1 2 3 4 5 6" );
		//System.out.println( "1 2 3 4 5 6" );
		
		int i = 1;
		while( i <= 6 ) {
			System.out.print( i + " " );
			++i;
		}
		System.out.println("");
		
		i = 1;
		int j = 1;
		while( j <= 6 ) {			// 행 row
			while( i <= 6 ) {		// 열 col
				System.out.print( i + " " );
				++i;
			}
			++j;
			i = 1;
			System.out.println("");
		}
		
		i = 1;
		j = 1;
		while( j <= 6 ) {			// 행 row
			while( i <= j ) {		// 열 col
				System.out.print( i + " " );
				++i;
			}
			++j;
			i = 1;
			System.out.println("");
		}
		System.out.println( "\n" );
		
		i = 1;
		while( i <= 6 ) {
			System.out.print( i + " " );
			++i;
		}
		System.out.println("");
		
		i = 1;
		j = 6;
		while( j >= 1 ) {			// 행 row
			while( i <= j ) {		// 열 col
				System.out.print( i + " " );
				++i;
			}
			--j;
			i = 1;
			System.out.println("");
		}
		System.out.println( "\n" );
		
		i = 1;
		while( i <= 6 ) {
			if ( i != 6 )
				System.out.print( " " );
			else
				System.out.print( i );
			++i;
		}
		System.out.println("");
		
		i = 6;
		while( i >= 1 ) {
			if ( i > 4 )
				System.out.print( " " );
			else
				System.out.print( i + " " );
			--i;
		}
		System.out.println("");
		
		i = 6;  j = 1;
		while( j <= 6 ) {
			while( i >= 1 ) {
				if ( i > j ) System.out.print( "  " );
				else System.out.print( i + " " );
				--i;
			}
			++j; i = 6;
			System.out.println( "" );
		}
		System.out.println( "" );
		
		for(int m = 1; m <= 6; ++m) {
			for( int k = 1; k <= 6; ++k ) {
				if ( k >= m )				
					System.out.print( (k - (m - 1)) + " " );
				else 
					System.out.print( "  " );
			}
			System.out.println( "" );
		}
		
	}

}




